package com.shanzmoo.base.annotation;

import com.shanzmoo.base.aop.IntInValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 指定数据集
 * @author: Gzhao 2020/12/14
 */
@Constraint(validatedBy = IntInValidator.class)
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface IntIn {

    /**
     * 提示信息
     */
    String message() default "";

    /**
     * 目标字符串数组
     */
    int[] values() default {};

    /**
     * 是否允许空值
     */
    boolean allowNull() default false;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
